package Experiment3;

public class IDCard extends Card{
    private String IDNumber;
    public IDCard(){

    }
    public IDCard(String n,String id){
        super(n);
        this.IDNumber = id;
    }

    @Override
    public String format() {
        return super.format()+"\n"+"ID Number: "+IDNumber;
    }
    @Override
    public String toString(){
        return getClass()+"\n[name="+this.getName()+",IDNumber="+this.IDNumber+"]\n";
    }
    @Override
    public boolean equals(Object o){
        if(o instanceof IDCard){
            if(((IDCard) o).IDNumber==this.IDNumber)
                return true;
        }
        return false;
    }
}
